﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bluyel.Core
{
    /// <summary>
    /// Select mode set in typeLOV.
    /// define how many values can be selected: single, many or SetInVar.
    /// </summary>
    public enum TypeEnumSelectMode 
    {
        // can select a single value, the default case
        Single,

        // can select many values
        Many,

        // not defined in the type, defined in each var data: Single or Many
        SetInVar,
    }

    /// <summary>
    /// Represents a type LOV (List Of Value) or enum.
    /// </summary>
    public interface ITypeEnum : IType
    {
        // the type of values
        IType TypeValue { get; }

        TypeEnumSelectMode SelectMode { get; }

        int ValuesCount { get; }

        // items of the LOV
        IEnumerable<IValue> ListItems { get; }

        bool Contains(IValue dvValue);

        IValue GetAt(int pos);

        // add an item to the LOV, the type of DV must match the item type defined in the LOV
        bool AddItem(IValue value);

        // remove a value, by pos
        bool RemoveByPos(int pos);

        bool Remove(IValue dataValue);

    }
}
